<?php
$query_lin=$db->query("select * from player_lin where l_start_times<='".time()."' ;");
while($list_lin=$db->fetch_array($query_lin))
{
  $resent_time=time();
  $end_times=time()+7*24*60*60;
  $db->query("insert into player_safe (id, u_id, c_id, mg_id, s_style, s_type, golds_style, s_name, s_golds, s_effect,s_num, s_level, s_start_times, s_end_times) values 
  (null, '".$list_lin['u_id']."', '".$list_lin['c_id']."',  '".$list_lin['mg_id']."', '".$list_lin['s_style']."', '".$list_lin['s_type']."', '".$list_lin['golds_style']."', '".$list_lin['s_name']."',  '".$list_lin['s_golds']."','".$list_lin['s_effect']."', '".$list_lin['s_num']."','".$list_lin['s_level']."','".$resent_time."','".$end_times."');");  
$db->query("delete from player_lin where id='".$list_lin['id']."' ");
}

?>